package com.hejjon.controller;


import com.hejjon.core.bean.ResponseResult;
import com.hejjon.core.controller.BaseController;
import com.hejjon.domain.request.LibraryCategoryRequest;
import com.hejjon.domain.vo.LibrarySettingItemVO;
import com.hejjon.service.ILibraryCategoryService;
import com.hejjon.service.ILibrarySettingService;
import lombok.Getter;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Map;

@RestController
@RequestMapping("/libraryCategory")
public class LibraryCategoryController extends BaseController {


    @Resource
    private ILibraryCategoryService libraryCategoryService;




    @PostMapping("/addNode")
    public ResponseResult addNode(@RequestBody LibraryCategoryRequest request) {
        libraryCategoryService.addNode(request);
        return success("新增成功");
    }


    @GetMapping("/listLibraryCategoryTree")
    public ResponseResult listLibraryCategoryTree() {
        return success(libraryCategoryService.listLibraryCategoryTree());
    }


    @GetMapping("/removeNode")
    public ResponseResult removeNode(@RequestParam String nodeId) {
        return toResult(libraryCategoryService.removeCategoryNode(nodeId));
    }




}

